import os
import sys
import django

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'day_05.settings')
django.setup()  # 伪造让django启动

from web import models
from utils.encrypt import md5


# 先创建级别
# level_object = models.Level.objects.create(title="VIP", percent=90)
# models.Customer.objects.create(
#     username='zll',
#     password=md5('zll123'),
#     mobile='18250155771',
#     level_id=1,
#     creator_id=1,
# )
# models.Customer.objects.create(
#     username='zxc',
#     password=md5('zxc123'),
#     mobile='18250155771',
#     level_id=1,
#     creator_id=1,
# )

# for i in range(1, 8):
#     models.Customer.objects.create(
#         username='zll{}'.format(i),
#         password=md5('zll{}'.format(i)),
#         mobile='18251067793',
#         level_id=4,
#         creator_id=1,
#     )
